project_dic = {
    "AN": "AN 广东太平岭核电一期工程项目",
    "AD": "AD 广东太平岭核电二期工程项目",
    "BJ": "BJ 浙江三澳核电项目",
    "BS": "BS 广西防城港核电二期工程项目 ",
    "BZ": "BZ 福建宁德核电二期项目",
    "BT": "BT 防城港核电三期（5、6号机组）项目 ",
    "LF": "LF 广东陆丰核电5、6号机组项目",
    "CS": "CS 浙江三澳核电二期工程项目",
    "CW": "CW 中广核山东招远核电厂一期工程",
    "SK": "SK 华能山东石岛湾核电厂扩建一期工程"
}

person_info = {"user_name": "盖仁涛",
               "user_code": "P206555",
               "sender_srt": "中广核工程有限公司 设备采购与成套中心 核岛主设备分部 张斌 经理",
               "inner_cc": "#PQA;#PQC;#PPL",
               "doc_review_type": False,
               "need_drafter": False,
               "visit_type": False,
               "file_num_per_page": 200,
               "ie_type": False,
               "file_path": "E:\\work\\contract_files",
               "drcs_checker": "P206304 陈泽勇",
               "drcs_approve": "P503422 钟本路"
               }
department_dic = {
    # "E", "E,C", "QA", "QA,QC", "C", "QC,PS*","PS*","QM"
    "E": ["E", "NPD", ""],
    "S": ["S", "SUE", ""],
    "PS*": ["P", "PSE", "purchaser_roler"],
    "QA": ["P", "PSE", "qa_roler"],
    "QC": ["P", "PSE", "qc_roler"],
    "QM": ["P", "PSE", "qm_roler"],
    "C": ["C", {
        "EC": "CME",
        "LF": "AFE",
        "AD": "HPE",
        "AN": "HPE",
        "BT": "BLE",
        "BS": "BLE",
        "BZ": "ABE",
        "CS": "CNE",
        "CW": "CWE",
        "SK": "SKE",
        "BJ": "CNE",
    }, ""],

}


def get_department(code, project="EC"):
    if not project:
        project = "EC"
    depart_dic = {"block": department_dic[code][0], "reviewer": department_dic[code][2]}
    # depart_dic["is_outer"] = code in ["C","E","S"]
    if code == "C":
        depart_dic["depart"] = department_dic[code][1][project]
    else:
        depart_dic["depart"] = department_dic[code][1]
    return depart_dic


def get_channel_info(channel_code: str) -> dict:
    "007-AD-L-NSCE-F-GENS-700078"
    channel_code_list = channel_code.split("-")
    if len(channel_code_list) == 7:
        return {
            "project_code": channel_code_list[1],
            "factory_code": channel_code_list[3]

        }
